//预言家
module.exports = function(room,chair) {
	var basic = require("./roleBasic.js")
	basic.call(this,chair)
	console.log(basic)
	this.name = "预言家"			//角色名
	this.role = "seer"			//角色类型
	this.camp = "protoss"   	//阵营	werewolf  protoss  villager
	this.survive = true 	  	//存活状态
	this.votePower = true   	//投票权
	this.showRole = "normal"	//显示状态   
	this.checkList = [] 		//查验列表
	this.state = true 			//本轮操作状态
	//角色行动
	this.action = function(type,target,cb) {
		if(room.state != room.NIGHT_SEER_STATE){
			cb(false,"不在预言家阶段")
			return
		}
		if(this.role !== "seer"){
			cb(false,"身份错误：seer : "+this.role)
			return
		}
		if(!this.survive){
			cb(false,"已死亡")
			return
		}
		if(!this.state){
			cb(false,"本轮已操作")
			return
		}
		if(typeof(target) != "number" || !room.roleList[target].survive){
			cb(false,"目标错误 : "+target)
			return
		}
		for(var i = 0;i < this.checkList.length;i++){
			if(this.checkList[i].target == target){
				cb(false,"已验过该玩家")
				return
			}
		}
		this.state= false
		if(room.roleList[target].camp == "werewolf"){
			this.checkList.push({target : target,result :  "bad"})
			cb(true,"badPerson")
		}else{
			this.checkList.push({target : target,result :  "good"})
			cb(true,"good")
		}
		room.nextTime = 3000
	}
	//获取自身信息
	this.getRoleInfo = function() {
		var info = {
			name : this.name,
			role : this.role,
			camp : this.camp,
			survive : this.survive,
			votePower : this.votePower,
			showRole : this.showRole,
			checkList : this.checkList
		}
		return info
	}
}